package ar.uba.fi.tonyvaliente.utils;

public class Pair<A,B> {
	private A first;
	private B second;
	
	public A getFirst() {
		return first;
	}

	public B getSecond() {
		return second;
	}

	public Pair(A a, B b) {
		this.first = a;
		this.second = b;
	}
	
	public boolean equals(Pair<A,B> p) {
		return this.first.equals(p.first) && this.second.equals(p.second);
	}
	
	@SuppressWarnings("unchecked")
	public boolean equals(Object o) {
		if (o == null) return false;
		if (o == this) return true;
		if (! (o instanceof Pair)) return false;
		Pair<A,B> o2 = (Pair<A,B>)o;
		return equals(o2);
	}
}
